<!-- css -->
<link href="__PUBLIC__/ganged/Css/city-picker.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" charset="utf-8" src="__PUBLIC__/admin/js/uploadify/jquery.uploadify.min.js" ></script>
<link rel="stylesheet" charset="utf-8" type="text/css" href="__PUBLIC__/admin/js/uploadify/uploadify.css"> 
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/admin/js/upload.js" ></script>
<div class="container" style="padding-top: 50px;">
    <div class="row clearfix">
        <div class="col-md-12 column">
            <form class="form-horizontal" role="form" id="post_form" action="{:U('')}">
                <div class="form-group">
                    <label for="title" class="col-sm-2 control-label">标题:<span style="color: red;">*</span></label>
                    <div class="col-sm-9">
                        <input type="text" class="form-control" name="title" id="title" />
                    </div>
                </div>
                <div class="form-group">
                    <label for="video" class="col-sm-2 control-label">视频(mp4格式):<span style="color: red;">*</span></label>
                    <div class="col-sm-10 js_upload_video">
                        <input type="file" class="form-control" id="video"><br /> 
                        <div name="video" class="upviewer">
                            <ul></ul>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label for="sort" class="col-sm-2 control-label">排序:<span style="color: red;">*</span></label>
                    <div class="col-sm-9">
                        <input type="number" min="0"  class="form-control" name="sort" value="{$sort}" />
                    </div>
                </div>
                <div class="form-group">
                    <label for="status" class="col-sm-2 control-label">状态:<span style="color: red;">*</span></label>
                    <div class="col-sm-9">
                        <label class="radio-inline">
                            <input type="radio" name="status" checked value="1">开启
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="status" value="0">关闭
                        </label>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <button type="button" class="btn btn-primary" id="btn" lng="0" lat="0">提交</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<script>
    $(function () {
        $("#btn").click(function () {
            var $form = $("#post_form");
            var $data = {};
            var $form_data = $form.serializeArray();
            $.each($form_data, function (k, v) {
                $data[v.name] = v.value;
            });
            $.post($form.attr('action'), $data, function (obj) {
                alert(obj.m);
                if (obj.s) {
                    if (typeof (obj.url) != "undefined" && obj.url) {
                        location.href = obj.url;
                    }
                }
            });
            return false;
        });
    });
</script>